from rest_framework.serializers import ModelSerializer

from apps.order.models import OrderInfo, OrderGoods


# 订单信息商品序列化器
class OrderGoodsSerializer(ModelSerializer):
    class Meta:
        model = OrderGoods
        fields = ['price', 'count']


# 订单信息序列化器
class OrderModelSerializer(ModelSerializer):

    # goods = OrderGoodsSerializer(many=True)
    
    class Meta:
        model = OrderInfo
        fields = '__all__'
